package com.li.network.lab_3;

import java.io.BufferedReader;
import java.io.IOException;

public class Parser {
    public static void getMessage(BufferedReader reader) throws IOException {
        String line = reader.readLine();
        Integer number = null;
        if (line != null) {
            number = Integer.parseInt(line.substring(0, 3));
            if (number == -1) {
                throw new RuntimeException("响应信息错误: " + line);
            } else if (number >= 400) {
                throw new RuntimeException("发送邮件失败: " + line);
            }
            System.out.println(line);
        }
    }
}
